﻿using GeneralServices.PatternCommand;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleAppTestPatternCommand
{
    public class Program
    {
        static void Main(string[] args)
        {
            // Create user and let her compute
            User user = new User(new Calculator());

            // User presses calculator buttons
            AbstractCommandArgs a = new CommandCalcArgs();
            a.Fill(new object[] { 100, '+' });
            AbstractCommandArgs b = new CommandCalcArgs();
            b.Fill(new object[] { 50, '-' });
            AbstractCommandArgs c = new CommandCalcArgs();
            c.Fill(new object[] { 10, '*' });
            AbstractCommandArgs d = new CommandCalcArgs();
            d.Fill(new object[] { 2, '/' });

            user.Action(a);
            user.Action(b);
            user.Action(c);
            user.Action(d);

            user.Undo(1);
            
            user.Redo(1);
            
            AbstractCommandArgs e = new CommandCalcArgs();
            e.Fill(new object[] { 15, '+' });
            user.Action(e);


            user.Undo(2);

            // Wait for user
            Console.ReadKey();
        }
    }
}
